package com.mp.approvalreq.dao;

import com.mp.approvalreq.entity.AppendSign;

import java.sql.SQLException;
import java.util.Date;
import java.util.List;
import java.util.Map;

public interface AppendSignDao {

    void insertBatchAppendSigns(List<AppendSign> appendSigns) throws SQLException;

    void deleteAppendSignByRequestId(Integer requestId, Integer companyId) throws SQLException;

    List<AppendSign> selectAppendSignsByRequestId(Integer requestId) throws SQLException;

    /**
     * 查询用户补卡次数,按祖先模板分组
     *
     * @param companyId
     * @param companyInfoId
     * @param month
     * @return
     * @throws SQLException
     */
    Map<Integer, Integer> selectUserAppendSignsTimesMapByMonth(Integer companyId, Integer companyInfoId, String month) throws SQLException;

    Map<Integer, List<AppendSign>> selectAppendSignsByRequestIds(String requestIds) throws SQLException;

    /**
     * 查询全公司指定时间范围的补卡集合
     *
     * @param companyId
     * @param startTime
     * @param endTime
     * @return
     * @throws SQLException
     */
    List<AppendSign> selectCompanyAppendSignsByDateScope(Integer companyId, String startTime, String endTime) throws SQLException;

    /**
     * 批量查询用户指定时间范围的补卡集合
     *
     * @param companyId
     * @param companyInfoIds
     * @param startTime
     * @param endTime
     * @return
     * @throws SQLException
     */
    List<AppendSign> selectBatchUserAppendSignsByDateScope(Integer companyId, String companyInfoIds, String startTime, String endTime) throws SQLException;

    /**
     * 根据审批id查询补卡创建时间
     *
     * @param requestId
     * @return
     * @throws SQLException
     */
    Date selectCreateTimeByRequestId(Integer requestId) throws SQLException;
}
